<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/jeecms_sys/head.html"/>
<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
function optDelete() {
	if(Pn.checkedCount('ids')<=0) {
		$.alert("<@s.m 'global.prompt'/>","<@s.m 'error.checkRecord'/>");
		return;
	}
	$.confirm(doDelete,"<@s.m 'global.confirm'/>","<@s.m 'global.confirm.delete'/>");
}
function doDelete(){
	var f = getTableForm();
	f.action="register_item_delete.do";
	f.submit();
}
function optAdd(){
	var f = getTableForm();
	f.action="register_item_add.do";
	f.submit();
}
function optSaveOrder() {
	var f = getTableForm();
	f.action="register_item_priority.do";
	f.submit();
}
function backToList(o) {
	o.form.action='../register_item_list.do';
}
function disInput(o) {
	if(o.checked) {
		$(o).parent().parent().find('.dis').each(function(){$(this).removeAttr('disabled');});
	} else {	
		$(o).parent().parent().find('.dis').each(function(){$(this).attr('disabled','disabled');});
	}
}
</script>
</head>
<body>
<div class="box-positon">
	<div class="rpos"><@s.m "global.position"/>:  <@s.m "cmsConfig.function"/> - <@s.m "cmsConfig.function.member.register"/> - <@s.m "global.edit"/></div>
	<#include "inc_opt.html"/>
	<div class="clear"></div>
</div>
<div class="body-box">
<form id="tableForm" method="post">
<table class="pn-ltable" width="100%" cellspacing="0" cellpadding="0" border="0">
<thead class="pn-lthead">
<tr>
	<th width="25" align="center"><input type='checkbox' onclick='Pn.checkbox("ids",this.checked)'/></th>
	<th><@s.m "cmsModelItem.field"/></th>
	<th><@s.m "cmsModelItem.dataType"/></th>
	<th><@s.m "cmsModelItem.label"/></th>
	<th><@s.m "cmsModelItem.priority"/></th>
	<th><@s.m "global.operate"/></th>
</tr>
</thead>
<tbody class="pn-ltbody">
<#list registerItems as item>
<tr>
	<td align="center"><input type="checkbox" name="ids" value="${item.id}"/></td>
	<td align="center">${item.field}</td>
	<td align="center"><@s.m "cmsModelItem.type${item.dataType}"/></td>
	<td align="center"><input type="text" name="label" value="${item.label}" style="width:100px"/></td>
	<td align="center">
		<input type="text" name="priority" value="${item.priority}" style="width:40px"/>
		<input type="hidden" name="wids" value="${item.id}"/>
	</td>
	<td align="center">
		<a href="register_item_edit.do?id=${item.id}" class="pn-opt"><@s.m "global.edit"/></a> |
		<a href="register_item_delete.do?ids=${item.id}" class="pn-opt" onclick="if(!$.confirmToUrl(this.href)) {return false;}"><@s.m "global.delete"/></a>
 	</td>
</tr>
</#list>
</tbody>
</table>

<input type="button" value="<@s.m "global.delete"/>" onclick="optDelete();" class="del-button"/>
&nbsp; <input class="save-content" type="button" value="<@s.m "cmsModelItem.saveContent"/>" onclick="optSaveOrder();"/>
<input type="button" value="<@s.m "global.add"/>" onclick="optAdd();" class="add" />
</div>

</form>
</div>
<#include "/common/alert_message.html"/>
</body>
</html>